package 方法重写;

public class Test {
    public static void main(String[] args) {
        //测试狗类
        Dog d=new Dog();
        d.name="柴犬";
        d.age=2;
        d.sex="狗";
        d.showDog();
        System.out.println("---------------------");
        d.eat();
        d.duty();
        d.sleep();
        System.out.println("---------------------");

        //测试猫类
        Cat c=new Cat();
        c.name="Tim";
        c.age=3;
        c.sex="猫";
        c.showCat();
        System.out.println("---------------------");

        c.eat();
        c.sleep();
        c.duty();
        System.out.println("---------------------");

    }
}
